package br.uefs.dexa.rfframework.gui.interfaces;

import javax.swing.JPanel;

import br.unicamp.ic.lis.rfframework.objects.DigitalObject;
import br.unicamp.ic.lis.rfframework.objects.IDigitalObject;

public abstract class DigitalObjectPanel extends JPanel {
	
	private IDigitalObject object;
	private boolean isSelected = false;
	
	public enum Type 
	{
		QUERY, RELEVANT
	}

	protected DigitalObjectPanel(IDigitalObject object, int heigth)
	{
		this.object = object;
		showObject(object, heigth);
	}
	
	public IDigitalObject getDigitalObject()
	{
		return this.object;
	}
	
	/*
	 * monta interface para exibir o objeto digital, 
	 * deve ser implementado pelas classes filhas
	 */
	protected abstract void showObject(IDigitalObject object, int heigth);
	
	protected abstract void setRelevantSelectionBehavior(RFUserGUI gui);
	
	protected abstract void setQuerySelectionBehavior(RFUserGUI gui);
	
	protected abstract void foolBehavior(RFUserGUI gui);
	
	protected abstract void resetBehavior();
	
	
	public void setSelected(boolean selected)
	{
		this.isSelected = selected;
	}
	
	public void toogleSelected()
	{
		this.isSelected = !this.isSelected;
	}
	
	public boolean isSelected()
	{
		return isSelected;
	}
	
	public long getObjectId()
	{
		return object.getId();
	}
}
